/**
 * Copyright (c) 2010-2011 Pierre LABATUT
 *
 * This file is part of multiple-track-player project.
 *
 * multiple-track-player is free software: you can redistribute it and/or modify it
 * under the terms of its license which may be found in the accompanying
 * LICENSE file or <http://code.google.com/p/multiple-track-player/>.
 */
package multitrack.preload;

/**
 *
 * @author Pierre LABATUT
 */
public class Track {
    final HeapAudioBuffer buffer;
    boolean mute = false;
    boolean solo = false;
    float volume = 1;

    public synchronized void setMute(boolean mute) {
        this.mute = mute;
    }

    public synchronized void setSolo(boolean solo) {
        this.solo = solo;
    }

    public synchronized void setVolume(float volume) {
        if (volume < 0 || volume > 1.0) {
            throw new IllegalArgumentException("Volume shoud be in [0;1]");
        }
        this.volume = volume;
    }

    public Track(final HeapAudioBuffer buffer) {
        if (buffer == null) {
            throw new IllegalArgumentException();
        }
        this.buffer = buffer;
    }

    public synchronized boolean getMute() {
        return mute;
    }

    public synchronized boolean getSolo() {
        return solo;
    }

    public synchronized float getVolume() {
        return volume;
    }
    
}
